From 194dd19af2f4ebe29b135c3f839dfcb3b6acba2e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 7 Feb 2019 15:54:49 +0000 Subject: [PATCH] xen init script: silently exit status 0 if not running under xen This script should not complain at all if we are not running under Xen. Check this right at the start. This will enable improvements to the following code, which will no longer have to deal with the `not running under Xen' case. Signed-off-by: Ian Jackson Acked-by: Hans van Kranenburg --- debian/xen-utils-common.xen.init | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/xen-utils-common.xen.init b/debian/xen-utils-common.xen.init index 4b793d5ac2..da7d361453 100644 --- a/debian/xen-utils-common.xen.init +++ b/debian/xen-utils-common.xen.init @@ -20,6 +20,10 @@ XENSTORED_DIR="/var/run/xenstored" PATH=/sbin:/bin:/usr/sbin:/usr/bin DESC="Xen daemons" +case "$(cat /sys/hypervisor/type 2>/dev/null)" in +xen) ;; +*) exit 0 ;; # not running under Xen +esac ROOT=$(/usr/lib/xen-common/bin/xen-dir 2>/dev/null) if [ $? -ne 0 ]; then log_warning_msg "Not running within Xen or no compatible utils" -- 2.30.2